package yt.kpool.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;


import com.king.base.adapter.ViewHolderAdapter;
import com.king.base.adapter.holder.ViewHolder;

import java.util.List;

import yt.kpool.R;
import yt.kpool.bean.CurrencyList;
import yt.kpool.bean.CurrencyListBean;
import yt.kpool.network.NetHelperNew;
import yt.kpool.util.imageUtil.GlideUtil;

/**
 * 币种列表
 * Created by Administrator on 2017/8/7.
 */

public class CurrencyListAdapter extends ViewHolderAdapter<CurrencyList.DataBean> {

    public CurrencyListAdapter(Context context, List<CurrencyList.DataBean> listData) {
        super(context, listData);
    }

    @Override
    public View buildConvertView(LayoutInflater layoutInflater, CurrencyList.DataBean currencyListBean, int position) {
        return layoutInflater.inflate(R.layout.item_currency_list,null);
    }

    @Override
    public void bindViewDatas(ViewHolder holder, CurrencyList.DataBean currencyListBean, int position) {
        holder.setText(R.id.text,currencyListBean.getCode().toUpperCase());
        GlideUtil.loadImage(context, NetHelperNew.URL+currencyListBean.getIcon(),(ImageView) holder.getView(R.id.image),R.mipmap.failimage,R.mipmap.failimage);

    }
}
